<!--
 * @Author: lyx 2858535420@qq.com
 * @Date: 2022-10-10 22:31:07
 * @LastEditors: lyx 2858535420@qq.com
 * @LastEditTime: 2023-04-28 14:21:27
 * @FilePath: /antd-vue2-template/src/App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import { domTitle, setDocumentTitle } from '@/utils/dom-util';
import { i18nRender } from '@/locales';
import { updateTheme, updateThemeConfig, updateColorWeak } from '@/core/theme-setting';
import { appLatyouMixin } from '@/mixins/app-layout-mixin';

export default {
  name: 'App',
  mixins: [appLatyouMixin],
  data() {
    return {};
  },
  computed: {
    locale() {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta;
      title && setDocumentTitle(`${i18nRender(title)} - ${domTitle}`);

      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale;
    }
  },
  mounted() {
    updateTheme(this.navTheme);
    updateThemeConfig(this.themeConfig);
    updateColorWeak(this.colorWeak);
  }
};
</script>
